#pragma once

#include "../../../Libs/headers.default.h"

namespace ideal_observer
{

	class CEdglet
	{
	public:
		static const int Amount_OriBin = 8;
		static const int Amount_Edglet = Amount_OriBin * (Amount_OriBin - 1) / 2;
		static const double ExistThreshold_BlackStrength;
		static const double LengthRatio_DrawingEdge;

	public:
		int label;

	public:
		CEdglet(int EdgletLabel = -1);
		void myInit(int EdgletLabel);
		void Clear();
		bool fDoesExist() const;
		bool FromBinPair(int b1, int b2);
		bool ToBinPair(int& b1, int& b2) const;
		double FromImage(const int* qBaseBW, int W, int H, const CRectBox<int>& iBox);
		void ToImage(int* pBaseBW, int W, int H, const CRectBox<int>& iBox) const;
	public:
		static void DrawEdgeSegmentToImage(
			int *pBaseBW, int w, int h,
			int xa, int ya, int xb, int yb,
			int EdgeOriBin, double Probability);
		static void DrawCellDistributionToImage(
			int *pBaseBW, int W, int H, const CRectBox<int>& iBox,
			const double* pBase_P);
	};

};

using namespace ideal_observer;

